<?php

/**
 * This is the model class for table "cargo_export".
 *
 * The followings are the available columns in table 'cargo_export':
 * @property integer $id
 * @property integer $cargo_id
 * @property integer $export_information_id
 * @property string $remark
 * @property integer $export_id
 */
class make_export extends CModel
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return cargo_export the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
            return array(
                array('exporter, consignee, out_permit, awb, vessel, etd, mode, marking','required'),
                array('amount','numerical'),
                array('exporter_ref,remark', 'length', 'max'=>512),
                array('out_permit, mode', 'length', 'max'=>15),
                array('awb', 'length', 'max'=>25),
                array('vessel', 'length', 'max'=>50),
                array('etd','type','type'=>'date','dateFormat'=>'dd/MM/yyyy'),
            );
	}
	/**
	 * @return array customized attribute labels (name=>label)
	 */
        public function save(){
            if(!$this->validate())
                return false;
            return true;

        }
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'cargo_id' => 'Cargo',
			'export_information_id' => 'Export Information',
			'remark' => 'Remark',
			'export_id' => 'Export',
		);
	}
}